<?php
/* @var $this MahasiswaController */
/* @var $model Mahasiswa */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'mahasiswa-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array(
        'enctype' => 'multipart/form-data',
    ),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'NIM'); ?>
		<?php echo $form->textField($model,'NIM',array('size'=>8,'maxlength'=>8)); ?>
		<?php echo $form->error($model,'NIM'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>56,'maxlength'=>56)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstName'); ?>
		<?php echo $form->textField($model,'firstName',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'firstName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lastName'); ?>
		<?php echo $form->textField($model,'lastName',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'lastName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'middleName'); ?>
		<?php echo $form->textField($model,'middleName',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'middleName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'placeofBirth'); ?>
		<?php echo $form->textField($model,'placeofBirth',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'placeofBirth'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'dateofBirth'); ?>
                <?php 
                    $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model'=>$model, 'attribute'=>'dateofBirth',
                    'options'=>array(
                        'changeMonth'=>'true',
                        'changeYear'=>'true',
                        'yearRange'=> '1970:2000',
                        'dateFormat'=>'yy-mm-dd',
                        ),
                    'htmlOptions'=>array(''=>'')  // None at the moment
                    ));
                ?>
		<?php echo $form->error($model,'dateofBirth'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textField($model,'address',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'address'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'PhotoPath'); ?>
		<?php echo CHtml::activeFileField($model, 'PhotoPath'); ?>  // by this we can upload image
		<?php echo $form->error($model,'PhotoPath'); ?>
	</div>
        <?php if($model->isNewRecord!='1') ?>
        <div class="row">
                <?php echo CHtml::image(Yii::app()->request->baseUrl.'/data_foto/'.$model->PhotoPath,"image",array("width"=>200)); ?>  // Image shown here if page is update page
        </div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->